const http = require('http')
const fs = require('fs')

http.createServer((req, res)=>{
    // console.log(req.url)
    fs.readFile(`./${req.url}`,(err, data)=>{
        if(err){
            res.end('404 not found')
        }else{
            
            res.end(data)
        }
    })
    
}).listen(8080)